﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using APP.HELPER;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using HRM.CORE;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;
    using Security.ERP;

    public class xucSalaryPayAdd : Common.xucBaseAddH
    {
        private CalcEdit calMoney;
        private CalcEdit calOrder;
        private CalcEdit calPayMoney;
        private CalcEdit calRealMoney;
        private GridColumn colEmployeeCode;
        private GridColumn colFirstName;
        private GridColumn colLastName;
        private IContainer components = null;
        private DateEdit dtDate;
        private GroupControl gcTitle;
        private GridLookUpEdit glkEmployeeCode;
        private GridView gridLookUpEdit1View;
        private LabelControl labelControl1;
        private LabelControl labelControl2;
        private LabelControl labelControl3;
        private LabelControl labelControl4;
        private LabelControl labelControl5;
        private LabelControl labelControl6;
        private LabelControl labelControl7;
        private LabelControl labelControl8;
        private LabelControl labelControl9;
        private Guid m_SalaryPayID = Guid.Empty;
        public Guid m_SalaryTableListID = Guid.Empty;
        private MemoEdit txtDescription;
        private TextEdit txtEmployeeName;
        private TextEdit txtPerson;
        private MemoEdit txtReason;

        public event SuccessEventHander Success;

        public xucSalaryPayAdd()
        {
            this.InitializeComponent();
            this.InitData();
        }

        protected override void Add()
        {
            base.Add();
            HRM_SALARY_PAY hrm_salary_pay = new HRM_SALARY_PAY();
            this.dtDate.DateTime = System.DateTime.Now;
        }

        private void calMoney_EditValueChanged(object sender, EventArgs e)
        {
            if (((((this.calRealMoney != null) && (this.calMoney != null)) && ((this.calPayMoney != null) && (this.calRealMoney.EditValue != null))) && (this.calMoney.EditValue != null)) && (this.calPayMoney.EditValue != null))
            {
                this.calRealMoney.EditValue = decimal.Parse(this.calMoney.EditValue.ToString()) - decimal.Parse(this.calPayMoney.EditValue.ToString());
            }
        }

        private void calMoney_EditValueChanging(object sender, ChangingEventArgs e)
        {
            if (((((this.calRealMoney != null) && (this.calMoney != null)) && ((this.calPayMoney != null) && (this.calRealMoney.EditValue != null))) && (this.calMoney.EditValue != null)) && (this.calPayMoney.EditValue != null))
            {
                this.calRealMoney.EditValue = decimal.Parse(this.calMoney.EditValue.ToString()) - decimal.Parse(this.calPayMoney.EditValue.ToString());
            }
        }

        private void calOrder_EditValueChanged(object sender, EventArgs e)
        {
            if (int.Parse(this.calOrder.EditValue.ToString()) <= 0)
            {
                this.calOrder.EditValue = 1;
            }
        }

        public void Clear()
        {
            this.txtReason.Text = "";
            this.calMoney.EditValue = 0;
            this.calPayMoney.EditValue = 0;
            this.calRealMoney.EditValue = 0;
            this.dtDate.DateTime = System.DateTime.Now;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void glkEmployeeCode_EditValueChanged(object sender, EventArgs e)
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.glkEmployeeCode.EditValue.ToString());
            this.txtEmployeeName.Text = hrm_employee.FirstName + " " + hrm_employee.LastName;
            this.gcTitle.Text = "Th\x00f4ng Tin Thanh To\x00e1n Lương - " + hrm_employee.EmployeeCode + " (" + hrm_employee.FirstName + " " + hrm_employee.LastName + ")";
        }

        protected override void Init()
        {
            base.Init();
        }

        private HRM_SALARY_PAY InitClass()
        {
            return new HRM_SALARY_PAY { SalaryTableListID = this.m_SalaryTableListID, SalaryPayID = this.m_SalaryPayID, EmployeeCode = this.glkEmployeeCode.EditValue.ToString(), Order = int.Parse(this.calOrder.EditValue.ToString()), Reason = this.txtReason.Text, Date = this.dtDate.DateTime, Money = decimal.Parse(this.calMoney.EditValue.ToString()), PayMoney = decimal.Parse(this.calPayMoney.EditValue.ToString()), RealMoney = decimal.Parse(this.calRealMoney.EditValue.ToString()), Person = this.txtPerson.Text, Description = this.txtDescription.Text };
        }

        private void InitData()
        {
            new HRM_EMPLOYEE().AddGridLookupEdit(this.glkEmployeeCode);
            this.dtDate.DateTime = System.DateTime.Now;
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xucSalaryPayAdd));
            this.txtReason = new MemoEdit();
            this.dtDate = new DateEdit();
            this.calMoney = new CalcEdit();
            this.calPayMoney = new CalcEdit();
            this.calRealMoney = new CalcEdit();
            this.txtPerson = new TextEdit();
            this.txtDescription = new MemoEdit();
            this.labelControl1 = new LabelControl();
            this.labelControl2 = new LabelControl();
            this.labelControl3 = new LabelControl();
            this.labelControl4 = new LabelControl();
            this.labelControl5 = new LabelControl();
            this.labelControl6 = new LabelControl();
            this.labelControl7 = new LabelControl();
            this.glkEmployeeCode = new GridLookUpEdit();
            this.gridLookUpEdit1View = new GridView();
            this.colEmployeeCode = new GridColumn();
            this.colFirstName = new GridColumn();
            this.colLastName = new GridColumn();
            this.txtEmployeeName = new TextEdit();
            this.labelControl8 = new LabelControl();
            this.labelControl9 = new LabelControl();
            this.calOrder = new CalcEdit();
            this.gcTitle = new GroupControl();
            ((ISupportInitialize) base.Err).BeginInit();
            base.imageCollection2.BeginInit();
            this.txtReason.Properties.BeginInit();
            this.dtDate.Properties.VistaTimeProperties.BeginInit();
            this.dtDate.Properties.BeginInit();
            this.calMoney.Properties.BeginInit();
            this.calPayMoney.Properties.BeginInit();
            this.calRealMoney.Properties.BeginInit();
            this.txtPerson.Properties.BeginInit();
            this.txtDescription.Properties.BeginInit();
            this.glkEmployeeCode.Properties.BeginInit();
            this.gridLookUpEdit1View.BeginInit();
            this.txtEmployeeName.Properties.BeginInit();
            this.calOrder.Properties.BeginInit();
            this.gcTitle.BeginInit();
            this.gcTitle.SuspendLayout();
            base.SuspendLayout();
            base.btnSave.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            base.btnSave.Location = new Point(0xc6, 0x106);
            base.btnSave.TabIndex = 0x13;
            base.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            base.btnCancel.Location = new Point(0x193, 0x106);
            base.btnCancel.TabIndex = 0x15;
            base.btnSaveNew.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            base.btnSaveNew.Location = new Point(0x12b, 0x106);
            base.btnSaveNew.TabIndex = 20;
            base.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            this.txtReason.Location = new Point(0x52, 0x3d);
            this.txtReason.Name = "txtReason";
            this.txtReason.Size = new Size(0x19c, 0x33);
            this.txtReason.TabIndex = 6;
            this.dtDate.EditValue = null;
            this.dtDate.Location = new Point(0x52, 0x7d);
            this.dtDate.Name = "dtDate";
            this.dtDate.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.dtDate.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.dtDate.Size = new Size(100, 20);
            this.dtDate.TabIndex = 8;
            this.calMoney.Location = new Point(0xf4, 0x7d);
            this.calMoney.Name = "calMoney";
            this.calMoney.Properties.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.calMoney.Properties.Appearance.ForeColor = Color.Blue;
            this.calMoney.Properties.Appearance.Options.UseFont = true;
            this.calMoney.Properties.Appearance.Options.UseForeColor = true;
            this.calMoney.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calMoney.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calMoney.Size = new Size(100, 20);
            this.calMoney.TabIndex = 10;
            this.calMoney.EditValueChanged += new EventHandler(this.calMoney_EditValueChanged);
            this.calMoney.EditValueChanging += new ChangingEventHandler(this.calMoney_EditValueChanging);
            this.calPayMoney.Location = new Point(0x18a, 0x7d);
            this.calPayMoney.Name = "calPayMoney";
            this.calPayMoney.Properties.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.calPayMoney.Properties.Appearance.ForeColor = Color.Red;
            this.calPayMoney.Properties.Appearance.Options.UseFont = true;
            this.calPayMoney.Properties.Appearance.Options.UseForeColor = true;
            this.calPayMoney.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calPayMoney.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calPayMoney.Size = new Size(100, 20);
            this.calPayMoney.TabIndex = 12;
            this.calPayMoney.EditValueChanged += new EventHandler(this.calMoney_EditValueChanged);
            this.calPayMoney.EditValueChanging += new ChangingEventHandler(this.calMoney_EditValueChanging);
            this.calRealMoney.Location = new Point(0x52, 0x9d);
            this.calRealMoney.Name = "calRealMoney";
            this.calRealMoney.Properties.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.calRealMoney.Properties.Appearance.ForeColor = Color.DarkGreen;
            this.calRealMoney.Properties.Appearance.Options.UseFont = true;
            this.calRealMoney.Properties.Appearance.Options.UseForeColor = true;
            this.calRealMoney.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calRealMoney.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calRealMoney.Size = new Size(100, 20);
            this.calRealMoney.TabIndex = 14;
            this.txtPerson.Location = new Point(0x112, 0x9d);
            this.txtPerson.Name = "txtPerson";
            this.txtPerson.Size = new Size(220, 20);
            this.txtPerson.TabIndex = 0x10;
            this.txtDescription.Location = new Point(0x52, 190);
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.Size = new Size(0x19c, 0x33);
            this.txtDescription.TabIndex = 0x12;
            this.labelControl1.AllowHtmlString = true;
            this.labelControl1.Appearance.Options.UseTextOptions = true;
            this.labelControl1.Appearance.TextOptions.WordWrap = WordWrap.Wrap;
            this.labelControl1.AutoSizeMode = LabelAutoSizeMode.None;
            this.labelControl1.Location = new Point(10, 0x3f);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(60, 0x26);
            this.labelControl1.TabIndex = 5;
            this.labelControl1.Text = "L\x00fd do thanh to\x00e1n:";
            this.labelControl2.AllowHtmlString = true;
            this.labelControl2.Location = new Point(12, 0x7f);
            this.labelControl2.Name = "labelControl2";
            this.labelControl2.Size = new Size(0x3e, 14);
            this.labelControl2.TabIndex = 7;
            this.labelControl2.Text = "Ng\x00e0y t.to\x00e1n:";
            this.labelControl3.AllowHtmlString = true;
            this.labelControl3.Location = new Point(0xbd, 0x80);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new Size(0x36, 14);
            this.labelControl3.TabIndex = 9;
            this.labelControl3.Text = "Số tiền <color=blue>(*)</color>:";
            this.labelControl4.AllowHtmlString = true;
            this.labelControl4.Location = new Point(0x160, 0x80);
            this.labelControl4.Name = "labelControl4";
            this.labelControl4.Size = new Size(0x24, 14);
            this.labelControl4.TabIndex = 11;
            this.labelControl4.Text = "Nộp lại:";
            this.labelControl5.AllowHtmlString = true;
            this.labelControl5.Location = new Point(11, 0x9f);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new Size(0x3d, 14);
            this.labelControl5.TabIndex = 13;
            this.labelControl5.Text = "Thực t.to\x00e1n:";
            this.labelControl6.AllowHtmlString = true;
            this.labelControl6.Location = new Point(0xcf, 160);
            this.labelControl6.Name = "labelControl6";
            this.labelControl6.Size = new Size(0x3f, 14);
            this.labelControl6.TabIndex = 15;
            this.labelControl6.Text = "Người duyệt:";
            this.labelControl7.AllowHtmlString = true;
            this.labelControl7.Location = new Point(13, 0xc0);
            this.labelControl7.Name = "labelControl7";
            this.labelControl7.Size = new Size(0x40, 14);
            this.labelControl7.TabIndex = 0x11;
            this.labelControl7.Text = "Ghi ch\x00fa kh\x00e1c:";
            this.glkEmployeeCode.Location = new Point(0x52, 0x1d);
            this.glkEmployeeCode.Name = "glkEmployeeCode";
            this.glkEmployeeCode.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.glkEmployeeCode.Properties.NullText = "[Chọn M\x00e3 NV]";
            this.glkEmployeeCode.Properties.View = this.gridLookUpEdit1View;
            this.glkEmployeeCode.Size = new Size(100, 20);
            this.glkEmployeeCode.TabIndex = 1;
            this.glkEmployeeCode.EditValueChanged += new EventHandler(this.glkEmployeeCode_EditValueChanged);
            this.gridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.colEmployeeCode, this.colFirstName, this.colLastName });
            this.gridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridLookUpEdit1View.Name = "gridLookUpEdit1View";
            this.gridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridLookUpEdit1View.OptionsView.ShowAutoFilterRow = true;
            this.gridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.colEmployeeCode.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.colEmployeeCode.FieldName = "EmployeeCode";
            this.colEmployeeCode.Name = "colEmployeeCode";
            this.colEmployeeCode.Visible = true;
            this.colEmployeeCode.VisibleIndex = 0;
            this.colFirstName.Caption = "Họ l\x00f3t";
            this.colFirstName.FieldName = "FirstName";
            this.colFirstName.Name = "colFirstName";
            this.colFirstName.Visible = true;
            this.colFirstName.VisibleIndex = 1;
            this.colLastName.Caption = "T\x00ean";
            this.colLastName.FieldName = "LastName";
            this.colLastName.Name = "colLastName";
            this.colLastName.Visible = true;
            this.colLastName.VisibleIndex = 2;
            this.txtEmployeeName.Location = new Point(0xbc, 0x1d);
            this.txtEmployeeName.Name = "txtEmployeeName";
            this.txtEmployeeName.Size = new Size(0x9f, 20);
            this.txtEmployeeName.TabIndex = 2;
            this.labelControl8.AllowHtmlString = true;
            this.labelControl8.Location = new Point(10, 30);
            this.labelControl8.Name = "labelControl8";
            this.labelControl8.Size = new Size(0x3e, 14);
            this.labelControl8.TabIndex = 0;
            this.labelControl8.Text = "Chọn NV <color=red>(*)</color>:";
            this.labelControl9.AllowHtmlString = true;
            this.labelControl9.Location = new Point(0x163, 0x20);
            this.labelControl9.Name = "labelControl9";
            this.labelControl9.Size = new Size(0x4d, 14);
            this.labelControl9.TabIndex = 3;
            this.labelControl9.Text = "Lần thanh to\x00e1n:";
            this.calOrder.Location = new Point(0x1b3, 0x1d);
            this.calOrder.Name = "calOrder";
            this.calOrder.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.calOrder.Properties.Mask.UseMaskAsDisplayFormat = true;
            this.calOrder.Size = new Size(0x3b, 20);
            this.calOrder.TabIndex = 4;
            this.calOrder.EditValueChanged += new EventHandler(this.calOrder_EditValueChanged);
            this.gcTitle.Controls.Add(this.calOrder);
            this.gcTitle.Controls.Add(this.txtDescription);
            this.gcTitle.Controls.Add(this.labelControl9);
            this.gcTitle.Controls.Add(this.calMoney);
            this.gcTitle.Controls.Add(this.labelControl8);
            this.gcTitle.Controls.Add(this.dtDate);
            this.gcTitle.Controls.Add(this.txtEmployeeName);
            this.gcTitle.Controls.Add(this.txtReason);
            this.gcTitle.Controls.Add(this.glkEmployeeCode);
            this.gcTitle.Controls.Add(this.calPayMoney);
            this.gcTitle.Controls.Add(this.labelControl7);
            this.gcTitle.Controls.Add(this.calRealMoney);
            this.gcTitle.Controls.Add(this.labelControl6);
            this.gcTitle.Controls.Add(this.txtPerson);
            this.gcTitle.Controls.Add(this.labelControl5);
            this.gcTitle.Controls.Add(this.labelControl1);
            this.gcTitle.Controls.Add(this.labelControl4);
            this.gcTitle.Controls.Add(this.labelControl2);
            this.gcTitle.Controls.Add(this.labelControl3);
            this.gcTitle.Dock = DockStyle.Top;
            this.gcTitle.Location = new Point(0, 0);
            this.gcTitle.Name = "gcTitle";
            this.gcTitle.Size = new Size(0x1fd, 250);
            this.gcTitle.TabIndex = 0x16;
            this.gcTitle.Text = "Th\x00f4ng Tin Thanh To\x00e1n Lương";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.gcTitle);
            base.Name = "xucSalaryPayAdd";
            base.Size = new Size(0x1fd, 0x12a);
            base.Controls.SetChildIndex(this.gcTitle, 0);
            base.Controls.SetChildIndex(base.btnCancel, 0);
            base.Controls.SetChildIndex(base.btnSave, 0);
            base.Controls.SetChildIndex(base.btnSaveNew, 0);
            ((ISupportInitialize) base.Err).EndInit();
            base.imageCollection2.EndInit();
            this.txtReason.Properties.EndInit();
            this.dtDate.Properties.VistaTimeProperties.EndInit();
            this.dtDate.Properties.EndInit();
            this.calMoney.Properties.EndInit();
            this.calPayMoney.Properties.EndInit();
            this.calRealMoney.Properties.EndInit();
            this.txtPerson.Properties.EndInit();
            this.txtDescription.Properties.EndInit();
            this.glkEmployeeCode.Properties.EndInit();
            this.gridLookUpEdit1View.EndInit();
            this.txtEmployeeName.Properties.EndInit();
            this.calOrder.Properties.EndInit();
            this.gcTitle.EndInit();
            this.gcTitle.ResumeLayout(false);
            this.gcTitle.PerformLayout();
            base.ResumeLayout(false);
        }

        private void RaiseSuccessEventHander(HRM_SALARY_PAY item)
        {
            if (this.Success != null)
            {
                this.Success(this, item);
            }
        }

        public void SetData(HRM_SALARY_PAY item)
        {
            SYS_LOG.Insert("Thanh To\x00e1n Lương", "Xem", item.EmployeeCode);
            if (base.m_Status == Actions.Update)
            {
                this.glkEmployeeCode.Properties.ReadOnly = true;
                this.txtEmployeeName.Properties.ReadOnly = true;
            }
            this.m_SalaryTableListID = item.SalaryTableListID;
            this.m_SalaryPayID = item.SalaryPayID;
            this.glkEmployeeCode.EditValue = item.EmployeeCode;
            this.calOrder.EditValue = item.Order;
            this.txtReason.Text = item.Reason;
            this.dtDate.DateTime = item.Date;
            this.calMoney.EditValue = item.Money;
            this.calPayMoney.EditValue = item.PayMoney;
            this.calRealMoney.EditValue = item.RealMoney;
            this.txtPerson.Text = item.Person;
            this.txtDescription.Text = item.Description;
        }

        protected override string uc_Change()
        {
            return string.Empty;
        }

        protected override string uc_Delete()
        {
            HRM_SALARY_PAY item = new HRM_SALARY_PAY {
                EmployeeCode = this.glkEmployeeCode.EditValue.ToString()
            };
            string str = item.Delete();
            if (str == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            return str;
        }

        protected override string uc_Save()
        {
            if (MyRule.Get(MyLogin.RoleId, "bbiEmployee") != "OK")
            {
                return "";
            }
            if (!MyRule.AllowAdd)
            {
                MyRule.Notify();
                return "";
            }
            if (this.glkEmployeeCode.EditValue == null)
            {
                XtraMessageBox.Show("Vui l\x00f2ng chọn nh\x00e2n vi\x00ean để lưu dữ liệu!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK);
                return "";
            }
            if (this.calOrder.EditValue == null)
            {
                XtraMessageBox.Show("Vui l\x00f2ng chọn đợt thanh to\x00e1n để lưu dữ liệu!", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK);
                return "";
            }
            SYS_LOG.Insert("Thanh To\x00e1n Lương", "Th\x00eam", this.glkEmployeeCode.EditValue.ToString());
            Cursor.Current = Cursors.WaitCursor;
            this.m_SalaryPayID = Guid.NewGuid();
            HRM_SALARY_PAY item = new HRM_SALARY_PAY();
            item = this.InitClass();
            if (item == null)
            {
                return "FALSE";
            }
            base.SetWaitDialogCaption("Đang lưu dữ liệu...");
            string text = item.Insert();
            if (text == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            Cursor.Current = Cursors.Default;
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            this.DoHide();
            return text;
        }

        protected override string uc_Update()
        {
            if (MyRule.Get(MyLogin.RoleId, "bbiEmployee") != "OK")
            {
                return "";
            }
            if (!MyRule.AllowEdit)
            {
                MyRule.Notify();
                return "";
            }
            SYS_LOG.Insert("Thanh To\x00e1n Lương", "Cập Nhật", this.glkEmployeeCode.EditValue.ToString());
            base.SetWaitDialogCaption("Đang cập nhật dữ liệu...");
            HRM_SALARY_PAY item = new HRM_SALARY_PAY();
            item = this.InitClass();
            string text = item.Update();
            if (text == "OK")
            {
                this.RaiseSuccessEventHander(item);
            }
            if (text != "OK")
            {
                XtraMessageBox.Show(text, "Cảnh B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            this.DoHide();
            return text;
        }

        private void xucSalaryPayAdd_Load(object sender, EventArgs e)
        {
            this.calMoney.EditValueChanging += new ChangingEventHandler(this.calMoney_EditValueChanging);
            this.calPayMoney.EditValueChanging += new ChangingEventHandler(this.calMoney_EditValueChanging);
        }

        public delegate void SuccessEventHander(object sender, HRM_SALARY_PAY item);
    }
}

